package com.ruoyi.web.controller.teaching;


import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.teaching.service.PlatformFFeedbackLikeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 王旭
 * @since 2025-02-12
 */
@RestController
@RequestMapping("/platform/feedbackLike")
@Api(tags = "platform-反馈点亮管理")
public class PlatformFFeedbackLikeController {
    @Autowired
    private PlatformFFeedbackLikeService platformFFeedbackLikeService;

    /**
     * 新增点亮
     */
    @PostMapping("/addLike")
    @ApiOperation(value = "新增点亮", notes = "新增点亮")
    @Log(title = "【新增点亮】", businessType = BusinessType.INSERT)
    public AjaxResult addFeedbackLike(Long objectId) {
        return platformFFeedbackLikeService.addFeedbackLike(objectId);
    }

    /**
     * 取消点亮
     */
    @DeleteMapping("/cancelLike/{ids}")
    @ApiOperation(value = "取消点亮", notes = "取消点亮（详情页左上角使用）")
    @Log(title = "取消点亮", businessType = BusinessType.DELETE)
    public AjaxResult cancelFeedbackLike(@PathVariable("ids") Long[] ids) {
        return platformFFeedbackLikeService.cancelFeedbackLike(ids);
    }

    /**
     * 取消点亮
     */
    @DeleteMapping("/deleteLike/{ids}")
    @ApiOperation(value = "取消点亮", notes = "取消点亮（查询我的点亮页面使用）")
    @Log(title = "取消点亮", businessType = BusinessType.DELETE)
    public AjaxResult deleteFeedbackLike(@PathVariable("ids") Long[] ids) {
        return platformFFeedbackLikeService.deleteFeedbackLike(ids);
    }

    /**
     * 分页获取个人点亮数据
     */
    @GetMapping("/personalLike")
    @ApiOperation(value = "分页获取个人点亮数据", notes = "分页获取个人点亮数据")
    public AjaxResult getPersonalLike(Integer pageNum, Integer pageSize, Integer type) {
        return platformFFeedbackLikeService.getPersonalLike(pageNum, pageSize, type);
    }

}

